package com.bc004346.travelus;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;

/**
 * Created by Renats on 2/22/14.
 * System notification helper
 */
public class NotificationHelper {

    public static final int CHECKIN_NOTIFICATION_ID = 1;

    public static void displayNotification(Context context, String message) {

        Notification.Builder builder = new Notification.Builder(context);
        builder.setContentTitle("Checkin event")
                .setContentText(message)
                .setSmallIcon(R.drawable.ic_launcher);

        Notification notification = builder.getNotification();

        NotificationManager mgr =
                (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

        mgr.notify(CHECKIN_NOTIFICATION_ID, notification);
    }

    public static void removeNotification(Context context) {
        NotificationManager mgr =
                (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        mgr.cancel(CHECKIN_NOTIFICATION_ID);
    }
}
